package com.cw.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.cw.entity.IaSickbedinfo;
import com.cw.mapper2.IaSickbedinfoMapper;
import com.cw.service.IIaSickbedinfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 * IA_病床信息 服务实现类
 * </p>
 *
 * @author ly
 * @since 2021-11-03
 */
@Service
public class IaSickbedinfoServiceImpl extends ServiceImpl<IaSickbedinfoMapper, IaSickbedinfo> implements IIaSickbedinfoService {

    @Override
    public List<IaSickbedinfo> getJGBed() {
        LambdaQueryWrapper<IaSickbedinfo> lw = new LambdaQueryWrapper<>();
        lw.select(IaSickbedinfo::getBedNo,IaSickbedinfo::getDeptCode,IaSickbedinfo::getNurseCellCode);
        lw.eq(IaSickbedinfo::getGyBack,"1");
        lw.eq(IaSickbedinfo::getBedWeave,"1");
        return list(lw).stream().distinct().collect(Collectors.toList());
    }
}
